<template>
	<view :style="themeColor">
		<view class="page">
			<view class="flex benben-position-layout flex flex-wrap align-center detailsPage_flex_0"
				:style="{height:(88+StatusBarRpx)+'rpx',paddingTop:StatusBarRpx+'rpx', }">
				<view class='flex flex-wrap align-center justify-between flex-sub detailsPage_fd0_0'>
					<view class='flex flex-wrap align-center detailsPage_fd0_0_c0' @tap.stop="handleJumpDiy"
						data-type="back" data-url="1">
						<text class='fu-iconfont2  detailsPage_fd0_0_c0_c0'>&#xE794;</text>
					</view>
					<view class='flex flex-wrap align-stretch justify-center'>
						<text class='detailsPage_fd0_0_c1_c0'
							style="font-family: Alimama DongFangDaKai, Alimama DongFangDaKai;">详情</text>
					</view>
					<view class='flex flex-wrap align-center justify-end detailsPage_fd0_0_c0'>
					</view>
				</view>

			</view>
			<view :style="{height: (88+StatusBarRpx)+'rpx'}"></view>
			
			<view class="loading_css" v-if="isShow">
				<u-loading size="36" color="#AD3823"></u-loading>
				<view>加载中</view>
			</view>
			<block v-else>
				<view class="flex flex-direction flex-wrap align-stretch benben-flex-layout detailsPage_flex_1">
					<view class='flex flex-wrap align-center detailsPage_fd1_0'>
						<text class='detailsPage_fd1_0_c0'>课程信息</text>
						<view class='flex flex-wrap align-center detailsPage_fd1_0_c1'>
							<text class='detailsPage_fd1_0_c1_c0'>{{details.course_name}}{{details.course_num}}个({{details.category_name}})</text>
						</view>
					</view>
					<view class='flex flex-direction flex-wrap align-stretch detailsPage_fd1_1'>
						<view class='flex flex-wrap align-center detailsPage_fd1_1_c0'>
							<text class='detailsPage_fd1_0_c0'>学生信息</text>
							<image class='detailsPage_fd1_1_c0_c1' mode="aspectFit" :src='STATIC_URL+"637.png"'></image>
						</view>
						<view class='flex flex-wrap align-center detailsPage_fd1_1_c1'>
							<text class='detailsPage_fd1_1_c1_c0'>姓名</text>
							<text class='detailsPage_fd1_1_c1_c1'>{{details.receiver_name}}</text>
						</view>
						<view class='flex flex-wrap align-center detailsPage_fd1_1_c1'>
							<text class='detailsPage_fd1_1_c1_c0'>年龄</text>
							<text class='detailsPage_fd1_1_c1_c1'>{{details.age}}岁</text>
						</view>
						<view class='flex flex-wrap align-center detailsPage_fd1_1_c1'>
							<text class='detailsPage_fd1_1_c1_c0'>性别</text>
							<text class='detailsPage_fd1_1_c1_c1'>{{details.sex == 1 ? '男' : '女'}}</text>
						</view>
						<view class='flex flex-wrap align-center detailsPage_fd1_1_c1'>
							<text class='detailsPage_fd1_1_c1_c0'>地址</text>
							<text class='detailsPage_fd1_1_c4_c1'>{{details.address}}</text>
						</view>
					</view>
					<view class='flex flex-direction flex-wrap align-stretch detailsPage_fd1_2'>
						<view class='flex flex-wrap align-center detailsPage_fd1_1_c0'>
							<text class='detailsPage_fd1_0_c0'>付款信息</text>
						</view>
						<view class='flex flex-wrap align-center detailsPage_fd1_1_c1'>
							<text class='detailsPage_fd1_1_c1_c0'>课程总额</text>
							<text class='detailsPage_fd1_1_c1_c1'>￥{{details.order_money}}</text>
						</view>
						<view class='flex flex-wrap align-center detailsPage_fd1_1_c1'>
							<text class='detailsPage_fd1_1_c1_c0'>优惠券</text>
							<text class='detailsPage_fd1_1_c1_c1'>-￥{{details.coupon_money}}</text>
						</view>
						<view class='flex flex-wrap align-center detailsPage_fd1_1_c1'>
							<text class='detailsPage_fd1_1_c1_c0'>支付金额</text>
							<text class='detailsPage_fd1_1_c1_c1'>￥{{details.payable_money}}</text>
						</view>
						<view class='flex flex-wrap align-center detailsPage_fd1_1_c1'>
							<text class='detailsPage_fd1_1_c1_c0'>购买时间</text>
							<text class='detailsPage_fd1_2_c4_c1'>{{details.create_time}}</text>
						</view>
						<view class='flex flex-wrap align-center detailsPage_fd1_1_c1'>
							<text class='detailsPage_fd1_1_c1_c0'>支付方式</text>
							<text class='detailsPage_fd1_1_c1_c1'>{{details.pay_type}}</text>
						</view>
					</view>
				</view>
				
				<view class="study_btn" @tap.stop="goStudy">去学习</view>
			</block>

		</view>
		<view style="height: 120rpx;"></view>
	</view>
</template>
<script>
	export default {
		components: {},


		data() {
			return {
				isShow: true,
				order_sn: "",
				details: {},
			};
		},
		computed: {
			themeColor() {
				return this.$store.getters.themeColor
			},

		},
		watch: {},
		onLoad(options) {
			let {order_sn} = options;
			if (order_sn !== undefined) this.order_sn = order_sn;
			this.getData();
		},
		onUnload() {

		},
		onReady() {

		},
		onShow() {

		},
		onHide() {

		},
		onResize() {

		},
		onPullDownRefresh() {

		},
		onReachBottom(e) {

		},
		onPageScroll(e) {

		},
		methods: {
			getData() {
				this.$api.post(global.API_VERSION + '65587efb5b290', {
					order_sn: this.order_sn
				}).then(res => {
					// console.log(res);
					this.isShow = false;
					if (res.data.code == 1) {
						this.details = res.data.data;
					} else {
						this.$message.info(res.data.msg);
					}
				})
			},
			goStudy() {
				global.course_order = this.details.order_sn;
				uni.navigateTo({
					url: '/pages/shouye/toLearn/toLearn?aid=' + this.details.category_id
				})
			},
		}
	};
</script>
<style lang="scss" scoped>
	.study_btn {
		background: linear-gradient(90deg, #BB4834 0%, #96301D 100%);
		border-radius: 44rpx 44rpx 44rpx 44rpx;
		width: 686rpx;
		line-height: 80rpx;
		text-align: center;
		font-size: 32rpx;
		color: #FFFFFF;
		height: 80rpx;
		font-weight: 400;
		margin: 0rpx 0rpx 0rpx auto;
		font-family: Alimama DongFangDaKai;
		position: fixed;
		left: 32rpx;
		bottom: 32rpx;
	}
	.page {
		width: 100vw;
		overflow-x: hidden;
		min-height: calc(100vh - var(--window-bottom));
		background: url(https://www.guochaoxiaoju.com/uploads/mini/636.png) no-repeat;
		background-size: 100% auto;
	}

	.detailsPage_flex_0 {
		background: url(https://www.guochaoxiaoju.com/uploads/mini/636.png) no-repeat;
		width: 750rpx;
		height: 88rpx;
		overflow: hidden;
		z-index: 10;
		top: 0rpx;
		background-size: 100% auto !important;
	}

	.detailsPage_fd0_0_c1_c0 {
		font-size: 40rpx;
		font-weight: 400;
		color: #FFFFFF;
		line-height: 88rpx;
	}

	.detailsPage_fd0_0_c0_c0 {
		font-size: 38rpx;
		color: var(--benbenFontColor3);
	}

	.detailsPage_fd0_0_c0 {
		width: 120rpx;
	}

	.detailsPage_fd0_0 {
		padding: 0rpx 32rpx 0rpx 32rpx;
	}

	.detailsPage_flex_1 {
		padding: 0rpx 30rpx 0rpx 30rpx;
	}

	.detailsPage_fd1_2_c4_c1 {
		margin: 0rpx 0rpx 0rpx auto;
		color: #333333;
		font-size: 32rpx;
		font-weight: 400;
		-webkit-line-clamp: 1;
		overflow: hidden;
		text-overflow: ellipsis;
		display: -webkit-box;
		-webkit-box-orient: vertical;
		max-width: 350rpx;
	}

	.detailsPage_fd1_2 {
		background: #FFFFFF;
		border-radius: 16rpx 16rpx 16rpx 16rpx;
		padding: 28rpx 24rpx 32rpx 24rpx;
		margin: 24rpx 0rpx 0rpx 0rpx;
	}

	.detailsPage_fd1_1_c4_c1 {
		margin: 0rpx 0rpx 0rpx auto;
		color: #333333;
		font-size: 32rpx;
		font-weight: 400;
		-webkit-line-clamp: 1;
		overflow: hidden;
		text-overflow: ellipsis;
		display: -webkit-box;
		-webkit-box-orient: vertical;
		max-width: 480rpx;
	}

	.detailsPage_fd1_1_c1_c1 {
		margin: 0rpx 0rpx 0rpx auto;
		color: #333333;
		font-size: 32rpx;
		font-weight: 400;
		font-family: Source Han Sans CN, Source Han Sans CN;
	}

	.detailsPage_fd1_1_c1_c0 {
		color: #999999;
		font-size: 32rpx;
		font-weight: 400;
		font-family: Source Han Sans CN, Source Han Sans CN;
	}

	.detailsPage_fd1_1_c1 {
		padding: 20rpx 0rpx 20rpx 0rpx;
	}

	.detailsPage_fd1_1_c0_c1 {
		width: 55rpx;
		height: 55rpx;
		border-radius: 0rpx 0rpx 0rpx 0rpx;
		margin: 0rpx 0rpx 0rpx 300rpx;
	}

	.detailsPage_fd1_1_c0 {
		padding: 0rpx 0rpx 20rpx 0rpx;
	}

	.detailsPage_fd1_1 {
		background: #FFFFFF;
		border-radius: 16rpx 16rpx 16rpx 16rpx;
		padding: 28rpx 24rpx 32rpx 24rpx;
	}

	.detailsPage_fd1_0_c1_c0 {
		color: #333333;
		font-size: 32rpx;
		font-weight: 400;
		-webkit-line-clamp: 1;
		overflow: hidden;
		text-overflow: ellipsis;
		display: -webkit-box;
		-webkit-box-orient: vertical;
		max-width: 350rpx;
		font-family: Source Han Sans CN, Source Han Sans CN;
	}

	.detailsPage_fd1_0_c1 {
		margin: 0rpx 0rpx 0rpx auto;
	}

	.detailsPage_fd1_0_c0 {
		color: #333333;
		font-size: 36rpx;
		font-weight: 400;
		font-family: Alimama DongFangDaKai, Alimama DongFangDaKai;
	}

	.detailsPage_fd1_0 {
		background: #FFFFFF;
		border-radius: 16rpx 16rpx 16rpx 16rpx;
		padding: 32rpx 24rpx 32rpx 24rpx;
		margin: 49rpx 0rpx 24rpx 0rpx;
	}
</style>